﻿<UserControl x:Class="TextFileReaderModule.Views.TextLineView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:Converters="clr-namespace:WpfUIUtilities.Converters;assembly=WpfUIUtilities"
             xmlns:Behaviors="clr-namespace:WpfUIUtilities.Behaviors;assembly=WpfUIUtilities"
             mc:Ignorable="d" >

    <UserControl.Resources>
        <Converters:BooleanVisibilityConverter x:Key="BooleanVisibilityConverter" />
    </UserControl.Resources>
    
    <Grid>
        
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition />
        </Grid.ColumnDefinitions>
        
        <Grid.RowDefinitions>
            <RowDefinition Height="*"/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>

        <Button Command="{Binding ShowHideCommentCommand}"
            Grid.Column="0" Grid.Row="0" Grid.RowSpan="2"
            Content="{Binding ShowHideCommentCommandText}"
            ToolTip="{Binding ShowHideCommentCommandToolTip}"
        />
        
        <TextBlock 
            Grid.Column="1" Grid.Row="0" Behaviors:TextBlockFormattingBehaviour.FormattedText="{Binding Path=Value}"
            Text="{Binding Value}"
        />

        <TextBox MinWidth="1500"
            AcceptsReturn="True"
            Grid.Column="1" Grid.Row="1"
            Visibility="{Binding CommentIsVisible, Converter={StaticResource BooleanVisibilityConverter}}" 
            Text="{Binding Comment}"
        />

    </Grid>    
    
</UserControl>
